package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.WechatMessageCode;
import com.rockcent.mall.lib.domain.enumclass.WechatMessageType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by marco on 2017/5/24.
 * 微信公众号自动回复类
 */
@Entity
@Table(name = "message_autoreply_config")
@DynamicInsert
@DynamicUpdate
public class MessageAutoreply extends IDEntityMall {

    @Column(columnDefinition = "varchar(30) comment '代码'")
    @Enumerated(EnumType.STRING)
    private WechatMessageCode code;
    @Column(columnDefinition = "varchar(20) comment '类型'")
    @Enumerated(EnumType.STRING)
    private WechatMessageType type;
    @Column(columnDefinition = "MEDIUMTEXT comment '消息内容'")
    private String content;
    @Column(columnDefinition = "varchar(120) comment '素材ID'")
    private String mediaId;
    @Column(columnDefinition = "varchar(150) comment '标题'")
    private String mediaTitle;
    @Column(columnDefinition = "varchar(1000) comment '描述'")
    private String mediaDesc;
    @Column(columnDefinition = "varchar(500) comment '链接'")
    private String mediaUrl;
    @Column(columnDefinition = "bigint(20) comment '平台ID'")
    private Long mallId;

    public WechatMessageCode getCode() {
        return code;
    }

    public void setCode(WechatMessageCode code) {
        this.code = code;
    }

    public WechatMessageType getType() {
        return type;
    }

    public void setType(WechatMessageType type) {
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getMediaId() {
        return mediaId;
    }

    public void setMediaId(String mediaId) {
        this.mediaId = mediaId;
    }

    public String getMediaTitle() {
        return mediaTitle;
    }

    public void setMediaTitle(String mediaTitle) {
        this.mediaTitle = mediaTitle;
    }

    public String getMediaDesc() {
        return mediaDesc;
    }

    public void setMediaDesc(String mediaDesc) {
        this.mediaDesc = mediaDesc;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public String getMediaUrl() {
        return mediaUrl;
    }

    public void setMediaUrl(String mediaUrl) {
        this.mediaUrl = mediaUrl;
    }

    @Override
    public String toString() {
        return "MessageAutoreply{" +
                "id=" + id +
                ", code=" + code +
                ", type=" + type +
                ", content='" + content + '\'' +
                ", mediaId='" + mediaId + '\'' +
                ", mediaTitle='" + mediaTitle + '\'' +
                ", mediaUrl='" + mediaUrl + '\'' +
                ", mediaDesc='" + mediaDesc + '\'' +
                ", mallId=" + mallId +
                '}';
    }
}
